<!-- https://docs.camunda.org/manual/latest/reference/bpmn20/tasks/receive-task/ -->
<template>
  <Activity :element="element" :moddle="moddle" :bo="bo" @write="write">
    <Message
      v-if="propertyVisible('messageRef')"
      slot="detail"
      v-model="msg"
      :element="element"
      :moddle="moddle"
      @save-ref="saveRef"
    />
  </Activity>
</template>

<script>
import Activity from '../../embbed/Activity'
import Message from '../../part/detail/Message'
import elementHelper from '../../../mixins/elementHelper'

export default {
  name: 'ReceiveTask',
  components: {
    Activity,
    Message
  },
  mixins: [elementHelper],
  computed: {
    msg() {
      return this.element.businessObject.messageRef?.name
    }
  },
  methods: {
    saveRef(message) {
      this.write({ messageRef: message })
    }
  }
}
</script>
